# Search Filter Plugin

## Overview
This plugin will embed a panel at the top right of the search results to display a list of searches with which a user may refine the current search.

## Pre-requisites
*HPRM version*
HPRM 82 and above.
*JSON Support*
The JSON feature must be enabled in WebDrawer hptrim.config, for example set serviceFeatures="Html,Razor,Json".

## Limitation
Due to an inability in HPRM WebDrawer as at 3rd of August 2015 the filter mechanism is not available.  This requires that the filter simply append search clauses to the existing search.  The limitation is that to do this it must switch an OR search to an AND search.  An end user may find this confusing as there search results change when OR is switched to AND.

## Installation
To install this plugin:
  1. copy filterMenu.js to WebDrawer\scripts
  2. copy custom_scripts.cshtml to webdrawer\views (or your child folder of Views)

## Usage
To use this plugin edit custom_scripts.cshtml to include your own searches.  Make sure the object passed to addSearchFilterMenu() is a valid JSON object.

## Performance
Each filter clause is run against the HPRM database to verify that there is at least one result.  If there are no results it is not displayed, while the search has been optimized as much as possible this still adds an overhead to the HPRM server.  Of course the fewer filter clauses you add the less the overhead.  Take this into account when considering whether to use this plugin and how many clauses to include.